package com.qf.business.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.business.system.mapper.RolePowerTableMapper;
import com.qf.data.system.entity.RolePowerTable;
import com.qf.business.system.service.RolePowerTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * (RolePowerTable)表服务实现类
 *
 * @author makejava
 * @since 2022-05-26 16:17:30
 */
@Service
public class RolePowerTableServiceImpl extends ServiceImpl<RolePowerTableMapper, RolePowerTable> implements RolePowerTableService {

    @Autowired
    private RolePowerTableMapper rolePowerTableMapper;
    /**
     * 根据角色id查询  角色和权限中间表的关联记录
     * @param rid
     * @return
     */
    @Override
    public List<RolePowerTable> queryByRid(Long rid) {
        List<RolePowerTable> rolePowerTables = super.query().eq("rid",rid).list();

        return rolePowerTables;
    }

    /**
     * 批量插入
     * @param entityList
     * @return
     */
    @Override
    public boolean saveBatch(Collection<RolePowerTable> entityList) {
        return rolePowerTableMapper.saveBatch(entityList) >0;
    }


}


